package com.ruoyi.system.domain;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.enums.SexEnum;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.data.annotation.Transient;

import javax.validation.constraints.NotBlank;

/**
 * 旅客对象 tourist
 *
 * @author 强盛酒店
 * @date 2023-03-07
 */
public class Tourist extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 旅客id
     */
    private Long id;

    /**
     * 旅客姓名
     */
    @Excel(name = "旅客姓名")
    @NotBlank(message = "旅客姓名不能为空")
    private String name;

    /**
     * 性别
     */
    @NotBlank(message = "旅客性别不能为空")
    @Excel(name = "性别")
    private String sex;

    /**
     * 联系方式
     */
    @Excel(name = "联系方式")
    @NotBlank(message = "联系方式不能为空")
    private String phone;

    /**
     * 身份证号码
     */
    @Excel(name = "身份证号码")
    @NotBlank(message = "身份证号码不能为空")
    private String idCard;

    /**
     * 邮箱
     */
    @Excel(name = "邮箱")
    private String email;

    /**
     * 密码
     */
    @Excel(name = "密码")
    @NotBlank(message = "密码不能为空")
    private String password;

    /**
     * 创建人
     */
    @Excel(name = "创建人")
    private Long createUser;

    /**
     * 修改人
     */
    @Excel(name = "修改人")
    private Long updateUser;

    /**
     * 状态
     */
    @Excel(name = "状态")
    private Integer status;

    /**
     * 是否已删除
     */
    @Excel(name = "是否已删除")
    private Integer isDeleted;

    /**
     * 验证码
     */
    @Transient
    private String code;

    /**
     * 唯一标识
     */
    @Transient
    private String uuid;

    @Transient
    private String sexName;

    @Transient
    private String newPassWord;

    public String getNewPassWord() {
        return newPassWord;
    }

    public void setNewPassWord(String newPassWord) {
        this.newPassWord = newPassWord;
    }

    public String getSexName() throws Exception {
        if (sex != null) {
            sexName = SexEnum.getEnum(Integer.parseInt(sex)).getName();
        }
        return sexName;
    }

    public void setSexName(String sexName) {
        this.sexName = sexName;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getSex() {
        return sex;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPhone() {
        return phone;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getEmail() {
        return email;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getPassword() {
        return password;
    }

    public void setCreateUser(Long createUser) {
        this.createUser = createUser;
    }

    public Long getCreateUser() {
        return createUser;
    }

    public void setUpdateUser(Long updateUser) {
        this.updateUser = updateUser;
    }

    public Long getUpdateUser() {
        return updateUser;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getStatus() {
        return status;
    }

    public void setIsDeleted(Integer isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Integer getIsDeleted() {
        return isDeleted;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getUuid() {
        return uuid;
    }

    public void setUuid(String uuid) {
        this.uuid = uuid;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("name", getName())
                .append("sex", getSex())
                .append("phone", getPhone())
                .append("idCard", getIdCard())
                .append("email", getEmail())
                .append("password", getPassword())
                .append("remark", getRemark())
                .append("createUser", getCreateUser())
                .append("createTime", getCreateTime())
                .append("updateUser", getUpdateUser())
                .append("updateTime", getUpdateTime())
                .append("status", getStatus())
                .append("isDeleted", getIsDeleted())
                .toString();
    }
}
